#pragma once
#define USERIDLENGTH 10
#define PASSWORDLENGTH 10
typedef enum{
	event_Fserver_Login,
	event_Fserver_Logout,
	event_Fserver_Addnew,

}event_Fserver;
typedef int (*FserverCallback)(event_Fserver event, void* wparam, void* lparam,void* arg);
struct Userinfo{
	char id[USERIDLENGTH+1];
	char pwd[PASSWORDLENGTH+1];
	char nickname[32];
	int	headpic;
	Userinfo* next;
};
int Fserver_Init(char* ip,short port,int maxonlinenum,FserverCallback cb,void* cb_arg);
int Fserver_Stop();

Userinfo* getuserbyid(char* id);
int setuser(Userinfo* user);
int deleteuserbyid(char* id);
Userinfo* getvalidid();
Userinfo* getuserlist();

void close_log_write();
bool get_log_state();
void open_log_write();